﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:dataFormToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
                    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
                    xmlns:converters="clr-namespace:SoftSource.Timecard.Converters"
                    xmlns:library="clr-namespace:Silverlight.Library;assembly=SilverlightLibrary"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    mc:Ignorable="d">

    <DataTemplate x:Key="StartDateReportTemplate">
        <StackPanel>
            <dataFormToolkit:DataField Label="Start Date">
                <controls:DatePicker SelectedDate="{Binding Date, Mode=TwoWay}" />
            </dataFormToolkit:DataField>
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="EndDateReportTemplate">
        <StackPanel>
            <dataFormToolkit:DataField Label="End Date">
                <controls:DatePicker SelectedDate="{Binding Date, Mode=TwoWay}" />
            </dataFormToolkit:DataField>
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="DateReportTemplate">
        <StackPanel>
            <dataFormToolkit:DataField Label="Date">
                <controls:DatePicker SelectedDate="{Binding Date, Mode=TwoWay}" />
            </dataFormToolkit:DataField>
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="StartEndDateReportTemplate">
        <StackPanel Orientation="Horizontal">
            <dataFormToolkit:DataField Label="Start Date">
                <controls:DatePicker SelectedDate="{Binding StartDate, Mode=TwoWay}" />
            </dataFormToolkit:DataField>
            <dataFormToolkit:DataField Label="End Date">
                <controls:DatePicker SelectedDate="{Binding EndDate, Mode=TwoWay}" />
            </dataFormToolkit:DataField>
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="UserStartEndDateReportTemplate">
        <StackPanel Orientation="Horizontal">
            <StackPanel.Resources>
                <converters:UserIDConverter x:Key="UserIDConverter" />
            </StackPanel.Resources>
            <dataFormToolkit:DataField Label="User">
                <ComboBox ItemsSource="{Binding Users}"
                          DisplayMemberPath="FullName"
                          MinWidth="150"
                          SelectedItem="{Binding UserID, Mode=TwoWay, Converter={StaticResource UserIDConverter}}" />
            </dataFormToolkit:DataField>
            <dataFormToolkit:DataField Label="Start Date">
                <controls:DatePicker SelectedDate="{Binding StartDate, Mode=TwoWay}" />
            </dataFormToolkit:DataField>
            <dataFormToolkit:DataField Label="End Date">
                <controls:DatePicker SelectedDate="{Binding EndDate, Mode=TwoWay}" />
            </dataFormToolkit:DataField>
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="ProjectEndDateReportTemplate">
        <StackPanel Orientation="Horizontal">
            <StackPanel.Resources>
                <converters:ProjectIDConverter x:Key="ProjectIDConverter" />
            </StackPanel.Resources>
            <dataFormToolkit:DataField Label="Project">
                <ComboBox ItemsSource="{Binding Projects}"
                          DisplayMemberPath="Name"
                          MinWidth="150"
                          SelectedItem="{Binding ProjectID, Mode=TwoWay, Converter={StaticResource ProjectIDConverter}}" />
            </dataFormToolkit:DataField>
            <dataFormToolkit:DataField Label="End Date">
                <controls:DatePicker SelectedDate="{Binding EndDate, Mode=TwoWay}" />
            </dataFormToolkit:DataField>
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="ProjectStartEndDateReportTemplate">
        <StackPanel Orientation="Horizontal">
            <StackPanel.Resources>
                <converters:ProjectIDConverter x:Key="ProjectIDConverter" />
            </StackPanel.Resources>
            <dataFormToolkit:DataField Label="Project">
                <ComboBox ItemsSource="{Binding Projects}"
                          DisplayMemberPath="Name"
                          MinWidth="150"
                          SelectedItem="{Binding ProjectID, Mode=TwoWay, Converter={StaticResource ProjectIDConverter}}" />
            </dataFormToolkit:DataField>

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <Grid Grid.Row="0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>

                    <CheckBox Grid.Column="0"
                              x:Name="WeekCheckBox"
                              Content="This Week"
                              Margin="4"
                              IsChecked="{Binding ThisWeek, Mode=TwoWay}"/>
                    <CheckBox Grid.Column="1"
                              x:Name="MonthCheckBox"
                              Content="This Month"
                              Margin="4"
                              IsChecked="{Binding ThisMonth, Mode=TwoWay}" />
                    <CheckBox Grid.Column="2"
                              x:Name="YearCheckBox"
                              Content="This Year"
                              Margin="4"
                              IsChecked="{Binding ThisYear, Mode=TwoWay}" />
                    <CheckBox Grid.Column="3"
                              x:Name="ProjectToDate"
                              Content="Project To Date"
                              Margin="4"
                              IsChecked="{Binding ProjectToDate, Mode=TwoWay}" />
                </Grid>
                <Grid Grid.Row="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>

                    <StackPanel Grid.Column="0"
                                Margin="4">
                        <TextBlock Text="Start:" />
                        <controls:DatePicker x:Name="StartDatePicker"
                                             SelectedDate="{Binding StartDate, Mode=TwoWay}"
                                             Margin="3,0,0,0" />
                    </StackPanel>
                    <StackPanel Grid.Column="1"
                                Margin="4">
                        <TextBlock Text="End:" />
                        <controls:DatePicker x:Name="EndDatePicker"
                                             SelectedDate="{Binding EndDate, Mode=TwoWay}"
                                             Margin="3,0,0,0" />
                    </StackPanel>
                </Grid>
            </Grid>
        </StackPanel>
    </DataTemplate>
</ResourceDictionary>